# !/usr/bin/env python
# coding: utf-8
# @Time   : 2022/11/27 21:12
# @Author : 梁灿

import os, sys
sys.path.append((os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))))

from page.basepage import BasePage
from common.readelement import Element


article = Element('article')  # 获取article.yml
print(article['点击文章管理'])


class ArticlePage(BasePage):
    """文章管理"""

    def click_article(self):
        self.is_click(article['点击文章管理'])

    def click_add(self):
        self.is_click(article['点击新增'])

    def upload_cover(self,path,filename):
        self.upload_file(path=path,filename=filename,locator=article['点击文章封面'])

    def input_article_title(self, content):
        self.input_text(article['输入文章标题'], content)

    def input_article_introduction(self, content):
        self.input_text(article['输入文章简介'], content)

    def input_article_content(self, content):
        self.input_text(article['输入内容'], content)

    def upload_content_picture(self,path,filename):
        self.upload_file(path=path,filename=filename,locator=article['上传内容图片'])

    def click_sure(self):
        self.is_click(article['点击确定'])




